package server

import (
	"fmt"

	"gitee.com/kun-ease/libra/config"
	"github.com/gin-gonic/gin"
)

func HttpServer() (en *gin.Engine) {
	en = gin.New()
	en.Use(gin.Recovery())
	return
}
func HttpRun(en *gin.Engine) (err error) {
	conf := config.GetConf()
	if len(conf.Server.Name) < 1 {
		fmt.Println("server_name", conf.Server.Name)
		return
	}
	err = en.Run(fmt.Sprintf("0.0.0.0:%d", conf.Server.Port))
	return
}
